package com.onlineMIS.action.shared.common;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.onlineMIS.ORM.DAO.headQ.barCodeGentor.ProductBarcodePicService;
import com.onlineMIS.ORM.entity.headQ.inventory.ImgDetailsVO;
import com.onlineMIS.ORM.entity.headQ.user.UserInfor;
import com.onlineMIS.common.Common_util;
import com.onlineMIS.common.loggerLocal;
import com.opensymphony.xwork2.ActionContext;

@Controller
public class CommonJSPAction extends CommonAction{
	
	private static final long serialVersionUID = 1L;
	
	@Autowired
	private ProductBarcodePicService productBarcodePicService;
	
	/**
	 * 根据条码查询图片详情公共方法
	 * @return
	 * @throws Exception 
	 */
	public String viewImg() throws Exception{		
		
		loggerLocal.info("viewImg");
		
		ImgDetailsVO imgDetailsVO = productBarcodePicService.getImgPath(formBean.getBarcode());

		if (imgDetailsVO == null){
			addActionError("无法找到相应信息");
		} else {
		   uiBean.setImgDetailsVO(imgDetailsVO);
		}
		return "viewImg";
	}
	

}
